package com.dib.neo.bkfs.fs;

import com.dib.neo.bkfs.fs.BKFile;
import com.dib.neo.bkfs.fs.BKFileLock;
import com.dib.neo.bkfs.fs.FileInfo;
import java.nio.ByteBuffer;
import org.apache.bookkeeper.client.BKException;
import org.apache.zookeeper.KeeperException;

import java.io.Closeable;
import java.io.IOException;
import java.nio.file.FileAlreadyExistsException;
import java.nio.file.NoSuchFileException;
import java.util.List;

public interface FSClient extends Closeable {

  boolean touch(String path) throws IOException;

  boolean touch(String path, int blkSize) throws IOException;

  List<String> ls(String path) throws IOException;

  void rm(String path) throws IOException;

  void mv(String path, String target) throws IOException;

  void copy(String path, String target) throws IOException;

  void mkdir(String path) throws IOException;

  void mkdirs(String path) throws IOException;

  void mkdir(String path, int blkSize) throws IOException;

  void mkdirs(String path, int blkSize) throws IOException;

  boolean exists(String path);

  FileInfo getFile(String path) throws IOException;

  void truncate(String path, long size) throws IOException;

  int read(String path, long offset, ByteBuffer dst) throws IOException;

  int write(String path,long offset, ByteBuffer src) throws IOException;

  int read(String path, long offset) throws IOException;

}
